import Link from "next/link"; import { notFound } from "next/navigation"; import { AgentAvatar } from "@/components/agents/agent-avatar"; import { loadAgentFeed } from "@/lib/agent-monitor"; const statusClassMap = { working: "status-pill status-pill--working", idle: "status-pill status-pill--idle", warning: "status-pill status-pill--warning", offline: "status-pill status-pill--offline" } as const; type AgentDetailPageProps = { params: Promise<{ agentId: string; }>; }; export default async function AgentDetailPage({ params }: AgentDetailPageProps) { const { agentId } = await params; const feed = await loadAgentFeed("all"); const agent = feed.agents.find((item) => item.id === agentId); if (!agent) { notFound(); } return (

{agent.name}

这里保留单个 agent 的详细监控页,重点看当前任务、最近输出、心跳、队列和异常。

{agent.name}
{agent.role}
{agent.statusLabel} 主机 {agent.host} Owner {agent.owner}
返回总览
运行状态
当前状态
{agent.statusLabel}
最近心跳
{agent.lastHeartbeat}
运行时长
{agent.uptime}
最近刷新
{agent.updatedAt}
任务指标
任务ID {agent.taskId}
阶段 {agent.taskStage}
队列深度 {agent.queueDepth}
今日完成 {agent.todayCompleted}
当前任务
{agent.currentTask}
最近输出
{agent.lastOutput}
{agent.lastError ?
异常标记: {agent.lastError}
: null}
); }